#include <gtest/gtest.h>
#include <iostream>
#include "Memory.h"
#include "Variable.h"
#include "Data.h"

TEST(MemoryTest, CreateVariable) {
	Memory memory;
	memory.addVariable(Variable::createVariable("x", Data::createFloat(4.5f)));
	EXPECT_EQ(memory.getVariable("x")->getFloatValue(), 4.5f);
}

TEST(MemoryTest, SetVariablesToReferenced) {
	Memory memory;
	memory.addVariable(Variable::createVariable("x", Data::createInt(10)));
	EXPECT_EQ(memory.getVariable("x")->isReferenced(), false);
	memory.setDataHoldersToReferenced();
	EXPECT_EQ(memory.getVariable("x")->isReferenced(), true);
}